package com.bojiu.lawsearch.lawsearch.service;

import com.bojiu.lawsearch.lawsearch.model.Page;
import com.bojiu.lawsearch.lawsearch.model.Task;
import com.bojiu.lawsearch.lawsearch.util.JsonResult;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author: afdiao
 * @Date：2020/4/5 15:22
 * @Description:
 */
public interface TaskService {


    /**
     * 分页查询
     *
     * @param pageNum
     * @param pageSize
     * @return
     */
    Page<Task> getTaskList(int pageNum, int pageSize);

    JsonResult publish(Task task, int userId, HttpServletRequest request);

    JsonResult checkPay(int taskId, int userId);

    void publishByStatus(int taskId);

    JsonResult memberPay(int goodsId, HttpServletRequest request, int userId);

    Page<Task> getTask(int userId, int pageSize, int pageNum);

    /**
     * 查看工程师查看指派给自己的任务
     *
     * @param userId
     * @param pageSize
     * @param pageNum
     * @return
     */
    Page<Task> getEngineerMyTask(int userId, int pageSize, int pageNum);

    /**
     * 查看自己发布的任务
     *
     * @param userId
     * @param pageSize
     * @param pageNum
     * @return
     */
    Page<Task> geMyTask(int userId, int pageSize, int pageNum);

    JsonResult orderTask(int userId, int taskId);

    JsonResult fee(int fee, int userId, HttpServletRequest request);

    JsonResult handleTask(int taskId, int userId, String answer);

    JsonResult getBackList(int pageNum, int pageSize);

    /**
     * 匹配工程师
     *
     * @param taskId
     * @param engineerId
     * @return
     */
    JsonResult deploy(int taskId, int engineerId);

    /**
     * 给工程师打分
     *
     * @param task
     * @param star
     * @return
     */
    JsonResult marking(Task task, BigDecimal star);

    /**
     * 更换工程师
     *
     * @param task
     * @return
     */
    JsonResult changeEngineer(Task task);

    /**
     * 查询任务列表
     *
     * @param task
     * @return
     */
    List<Task> queryList(Task task);

    /**
     * 查询
     *
     * @param taskId
     * @return
     */
    Task queryById(int taskId);
}
